home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nannws22.zip / MOUSEDEM.PRG < prev    next >
Text File  |  1987-12-08  |  3KB  |  161 lines

  1. *********************************************
  2. *********************************************
  3. * Program: MOUSEDEM.PRG
  4. * Purpose: To demonstrate the BMOUSE routine:
  5. *               Using the mouse with Clipper
  6. *
  7. * Author:  Bao Hoang
  8. *******************************
  9.  
  10. public cur_opt, flag1
  11.  
  12. *******************************
  13. * Main routine
  14. *******************************
  15. CHOICE1 =SPACE(1)
  16.  
  17. set wrap on
  18. set scoreboard off
  19. flag1 = .t.
  20.  
  21. do while flag1
  22.   do PULL_DOWN
  23. enddo
  24.  
  25.  
  26.  
  27. *********************************************
  28. * PULL DOWN menu routines
  29. *********************************************
  30. procedure PULL_DOWN
  31.  
  32. * menu initialization
  33. flag = .t.
  34.  
  35. * display the menu screen
  36. do while .t.
  37.   SET COLOR TO W/N,w/n
  38.   CLEAR
  39.  
  40.   if flag
  41.     CSR_ON()
  42.   endif
  43.  
  44.   mprompt(01,02,"1st Choice")
  45.   mprompt(01,22,"2nd Choice")
  46.   mprompt(01,43,"3rd Choice")
  47.   mprompt(01,65,"4th Choice")
  48.  
  49.   menu to choice2
  50.  
  51.   if flag
  52.     CSR_OFF()
  53.   else
  54.     flag = .t.
  55.   endif
  56.  
  57.  
  58.   * perform selected option
  59.   do case
  60.     case choice2 =1
  61.       do PD with 1
  62.     case choice2 =2
  63.       do PD with 2
  64.     case choice2 =3
  65.       do PD with 3
  66.     case choice2 =4
  67.       flag1 = .f.
  68.       return
  69.   endcase
  70.  
  71. enddo
  72.  
  73. ********
  74. procedure PD
  75. parameters cur_opt
  76.  
  77. set color to
  78.  
  79. declare parr[5]
  80.  
  81. parr[1] = 'AAAAA'
  82. parr[2] = 'BBBBB'
  83. parr[3] = 'CCCCC'
  84. parr[4] = 'DDDDD'
  85. parr[5] = 'EEEEE'
  86.  
  87. notes = "This is a sample memo and is not intended to provide "
  88. notes = notes + " any stimulation other than what it has "
  89. notes = notes + "already provided."
  90.  
  91. set key 4 to RGHT
  92. set key 19 to LFT
  93.  
  94. M_SET_ON(10,10)
  95.  
  96. do case
  97.   case cur_opt = 1
  98.     @ 02,02 to 08,12 
  99.     for i = 1 to 5
  100.     @ i+2,05 prompt parr[i]
  101.     next
  102.     menu to choice3
  103.   case cur_opt = 2
  104.     @ 02,22 to 08,32 
  105.     for i = 1 to 5
  106.     @ i+2,25 prompt parr[i]
  107.     next
  108.     menu to choice3
  109.   case cur_opt = 3
  110.     @ 02,43 to 08,53 
  111.     for i = 1 to 4
  112.     @ i+2,46 prompt parr[i]
  113.     next
  114.     @ i+2,46 prompt 'MEMO '
  115.     menu to choice3
  116.     if choice3 = 5 
  117.       M_SET_OFF()
  118.       set key 4 to
  119.       set key 19 to
  120.       M_SET_ON(1,1)
  121.       memoedit(notes,12,1,23,78,.t.)    
  122.       cur_opt = 3
  123.       flag = .t.
  124.     endif
  125. endcase
  126.  
  127. M_SET_OFF()
  128.  
  129. set key 4 to
  130. set key 19 to 
  131.  
  132. return
  133.  
  134. **********
  135. procedure RGHT
  136. do case
  137.   case cur_opt = 1
  138.     keyboard chr(27)+"2"
  139.   case cur_opt = 2
  140.     keyboard chr(27)+"3"
  141.   case cur_opt = 3
  142.     keyboard chr(27)+"1"
  143. endcase
  144. set key 4 to
  145. flag = .f.
  146. return
  147. **********
  148. procedure LFT
  149. do case
  150.   case cur_opt = 1
  151.     keyboard chr(27)+"3"
  152.   case cur_opt = 2
  153.     keyboard chr(27)+"1"
  154.   case cur_opt = 3
  155.     keyboard chr(27)+"2"
  156. endcase
  157. set key 19 to
  158. flag = .f.
  159. return
  160.  
  161.